package trans.model.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the sa_attachment table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="sa_attachment"
 */

public abstract class BaseSaAttachment  implements Serializable {

	private static final long serialVersionUID = 1L;
	public static String REF = "SaAttachment";
	public static String PROP_CATEGORY = "Category";
	public static String PROP_RELATIVE_STATUS = "RelativeStatus";
	public static String PROP_FILE_NAME = "FileName";
	public static String PROP_SA_ID = "SaId";
	public static String PROP_ID = "Id";
	public static String PROP_CATEGORY_ID = "category_id";


	// constructors
	public BaseSaAttachment () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseSaAttachment (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer saId;
	private java.lang.String fileName;
	private java.lang.Integer relativeStatus;
	private java.lang.Integer category_id;

	// many to one
	private trans.model.AttachmentCategory category;
	private trans.model.Sa sa;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: sa_id
	 */
	public java.lang.Integer getSaId () {
		return saId;
	}

	/**
	 * Set the value related to the column: sa_id
	 * @param saId the sa_id value
	 */
	public void setSaId (java.lang.Integer saId) {
		this.saId = saId;
	}



	/**
	 * Return the value associated with the column: file_name
	 */
	public java.lang.String getFileName () {
		return fileName;
	}

	/**
	 * Set the value related to the column: file_name
	 * @param fileName the file_name value
	 */
	public void setFileName (java.lang.String fileName) {
		this.fileName = fileName;
	}



	/**
	 * Return the value associated with the column: relative_status
	 */
	public java.lang.Integer getRelativeStatus () {
		return relativeStatus;
	}

	/**
	 * Set the value related to the column: relative_status
	 * @param relativeStatus the relative_status value
	 */
	public void setRelativeStatus (java.lang.Integer relativeStatus) {
		this.relativeStatus = relativeStatus;
	}



	/**
	 * Return the value associated with the column: category_id
	 */
	public java.lang.Integer getCategory_id () {
		return category_id;
	}

	/**
	 * Set the value related to the column: category_id
	 * @param category_id the category_id value
	 */
	public void setCategory_id (java.lang.Integer category_id) {
		this.category_id = category_id;
	}



	/**
	 * Return the value associated with the column: category_id
	 */
	public trans.model.AttachmentCategory getCategory () {
		return category;
	}

	/**
	 * Set the value related to the column: category_id
	 * @param category the category_id value
	 */
	public void setCategory (trans.model.AttachmentCategory category) {
		this.category = category;
	}
	

	public trans.model.Sa getSa() {
		return sa;
	}

	public void setSa(trans.model.Sa sa) {
		this.sa = sa;
	}

	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof trans.model.SaAttachment)) return false;
		else {
			trans.model.SaAttachment saAttachment = (trans.model.SaAttachment) obj;
			if (null == this.getId() || null == saAttachment.getId()) return false;
			else return (this.getId().equals(saAttachment.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}